<?php

namespace app\models\base;

use Yii;

/**
 * This is the model class for table "{{%question}}".
 *
 * @property string $question_id
 * @property integer $questioner_id
 * @property string $title
 * @property string $content
 * @property integer $post_time
 * @property integer $disabled
 * @property integer $last_modify
 * @property string $question_img
 */
class Question extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%question}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['questioner_id', 'title', 'content', 'post_time'], 'required'],
            [['questioner_id', 'post_time', 'disabled', 'last_modify'], 'integer'],
            [['content'], 'string'],
            [['title', 'question_img'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'question_id' => '问题 ID',
            'questioner_id' => '提问人 ID',
            'title' => '标题',
            'content' => '内容',
            'post_time' => '发布时间',
            'disabled' => '是否删除',
            'last_modify' => '最后修改时间',
            'question_img' => '图片',
        ];
    }
}
